﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sparrow.Reflection
{
    public static class LinqExtensions
    {
        /// <summary>
        /// create type metadata collection for query
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static Metadata Metadata(this object instance)
        {
            return MetadataCache.Create(instance);
        }

        /// <summary>
        /// create dynamic accessor/invoker proxy
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static Proxy Proxy(this object instance)
        {
            return new Proxy(instance);
        }

        public static dynamic Dynamic(this object instance)
        {
            return new Proxy(instance);
        }
    }
}
